﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TT.Web.Controllers
{
    public class HomeController : Controller
    {
        private readonly Logic.Interfaces.ITTContext _dbContext;

        public HomeController(Logic.Interfaces.ITTContext ttContext)
        {
            _dbContext = ttContext;            
        }


        public ActionResult Index()
        {
            var allTournaments = _dbContext.Tournaments.OrderByDescending(x => x.TournamentDate).ToList();
            return View(allTournaments);
        }

    }
}
